package com.bigdata.assignment.problem2;

import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Partitioner;

import java.util.Random;

public class RandomPartitioner extends Partitioner<Text, IntWritable> {

    private Random rand = new Random();

    @Override
    public int getPartition(Text key, IntWritable value, int numPartitions) {
        return rand.nextInt(numPartitions);
    }
}
